[OpenWrt-Devel] [PATCH] ramips: Setup missing gpio exports and fine-tune the memory model number.
John Crispin
blogic at openwrt.org
Thu Jan 21 03:09:29 EST 2016
On 20/01/2016 04:26, John Clark wrote:
> GPIO Changes
> ~~~~~~~~~~~~
> The HLK-RM04 uses i2c and the top half of the uartf port for gpio. HiLink has labeled the RT5350 gpio1 pin as gpio0 on the device pinout, so it seems to make sense to export it as "hlk-rm04:gpio0" to avoid confusing it with the microcontroller's designation.
>
> gpio gpio0 gpio0 (pin 10, reset)
>
> i2c i2c_sd gpio1 (pin 8, hlk-rm04:gpio0)
> i2c i2c_sclk gpio2 (pin 9, hlk-rm04:gpio1)
>
> uartf dtr_n gpio11 (no pinout)
> uartf dcd_n gpio12 (no pinout)
> uartf dsr_n gpio13 (no pinout)
> uartf rin gpio14 (pin 25, wps)
>
> reference:
> http://www.hlktech.net/product_detail.php?ProId=39
> http://cdn.sparkfun.com/datasheets/Wireless/WiFi/RT5350.pdf
>
> Also note that there is no gpio to control the power led, so remove the incorrect mapping.
>
> Memory Model Number (trivial)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> The dts file references memory chip s25fl064k, which seems to have ever been used for the HiLink HLK-RM04. While it only causes a nag message in the kernel log, why not change it to the w25q32 which is commonly found on these devices.
>
> Signed-off-by: John Clark <inindev at gmail.com>
> ---
> target/linux/ramips/dts/HLKRM04.dts | 46 ++++++++++++++++++++++++++-----------
> 1 file changed, 32 insertions(+), 14 deletions(-)
>
> diff --git a/target/linux/ramips/dts/HLKRM04.dts b/target/linux/ramips/dts/HLKRM04.dts
> index f90a9ac..0a0705a 100644
> --- a/target/linux/ramips/dts/HLKRM04.dts
> +++ b/target/linux/ramips/dts/HLKRM04.dts
> @@ -18,17 +18,17 @@
> palmbus at 10000000 {
> uart at 500 {
> status = "okay";
> + pinctrl-0;
are you sure this bit is correct ?
> };
>
> spi at b00 {
> status = "okay";
> -
> m25p80 at 0 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "jedec,spi-nor";
> reg = <0 0>;
> - linux,modalias = "m25p80", "s25fl064k";
> + linux,modalias = "m25p80", "w25q32";
> spi-max-frequency = <10000000>;
>
> partition at 0 {
> @@ -60,9 +60,13 @@
> pinctrl {
> state_default: pinctrl0 {
> gpio {
> - ralink,group = "jtag";
> + ralink,group = "jtag", "i2c";
> ralink,function = "gpio";
> };
> + uartf_gpio {
> + ralink,group = "uartf";
> + ralink,function = "gpio uartf";
> + };
> };
> };
>
> @@ -82,25 +86,39 @@
> status = "okay";
> };
>
> + gpio-export {
> + compatible = "gpio-export";
> + #size-cells = <0>;
> +
> + /* I2C */
> + gpio1 {
> + /* I2C_I2C_SD */
> + gpio-export,name = "hlk-rm04:gpio0";
> + gpio-export,direction_may_change = <1>;
> + gpios = <&gpio0 1 0>;
> + };
> + gpio2 {
> + /* I2C_I2C_SCLK */
> + gpio-export,name = "hlk-rm04:gpio1";
> + gpio-export,direction_may_change = <1>;
> + gpios = <&gpio0 2 0>;
> + };
> + };
> +
> gpio-keys-polled {
> compatible = "gpio-keys-polled";
> #address-cells = <1>;
> #size-cells = <0>;
> poll-interval = <20>;
> -
> - wps {
> + reset {
> label = "reset";
> - gpios = <&gpio0 14 1>;
> + gpios = <&gpio0 0 1>;
> linux,code = <0x198>;
> };
> - };
> -
> - gpio-leds {
> - compatible = "gpio-leds";
> -
> - power {
> - label = "hlk-rm04:red:power";
> - gpios = <&gpio0 0 1>;
> + wps {
> + label = "wps";
> + gpios = <&gpio0 14 1>;
> + linux,code = <0x211>;
> };
> };
> };
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list