Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Oct 2014 16:15:43 -0300
From:      Luiz Otavio O Souza <lists.br@gmail.com>
To:        Ganbold Tsagaankhuu <ganbold@gmail.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: Allwinner A13 support (patches attached)
Message-ID:  <CAB=2f8yhMGXUmXPGEb4m_ND%2BJLkoi7y4k8KV2OEXw-d7tJkLcw@mail.gmail.com>
In-Reply-To: <CAGtf9xP3qBi3pXDHY7icA_-qrPYnPjTqKdf3oCc2OSHh3Tn3_A@mail.gmail.com>
References:  <18234.85.229.95.175.1412713132.squirrel@webmail.alvermark.net> <CAGtf9xP3qBi3pXDHY7icA_-qrPYnPjTqKdf3oCc2OSHh3Tn3_A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9 October 2014 01:46, Ganbold Tsagaankhuu wrote:
> On Wed, Oct 8, 2014 at 4:18 AM, Jakob Alvermark wrote:
>
>> Hello people!

Hello Jakob,

>>
>> I have been sitting on this for too long now. (Thanks Arun Thomas for
>> encouraging me to send this!)
>> I have this Allwinner A13 board from Olimex,
>>
>> https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/open-source-hardware
>>
>> I have made it boot FreeBSD-current, and here are the patches. Hoping
>> anyone (committers?) might be interrested in looking at this.
>>

Yay, nice work!

>> I also wanted to blink the onboard LED, so this is in the dts file:)
>> ---
>>         leds {
>>                 compatible = "gpio-leds";
>>
>>                 led1 {
>>                         label = "led1";
>>                         gpios = <&gpio 201 1>;
>>                 };
>>         };
>> ---
>> I do not get a /dev/led/led1 as I expected, manually toggling the LED with
>> 'gpioctl -t 201' works fine...

The gpio node from the DTS you are using (sun5i-a13.dtsi) uses '3' as
#gpio-cells:

 gpio: gpio@01c20800 {
                        #gpio-cells = <3>;
                        compatible = "allwinner,sun5i-gpio";
                        gpio-controller;
                        reg =<  0x01c20800 0x400 >;
                        interrupts = < 28 >;
                        interrupt-parent = <&AINTC>;
 };

So you need to adjust the gpios property for led and add a third value
(in this case: pin number, not used, pin flags):

leds {
    compatible = "gpio-leds";

    led1 {
        name =  "led1";
        gpios = <&gpio 201 0 1>;
    };
};

Changing the #gpio-cells back to 2 would also work.

>>
>
> Cool.
>
> Can a10_gpio.c and a13_gpio.c combined into one?
> Also you disabled some gpio settings in a10_ehci.c I guess olinuxino has
> u-boot and u-boot sets that, or maybe different pins.
> I think instead of disabling better make it work for both cubieboard and
> olinuxino.

Yes, they can. I've checked and the only differences are the number of
available banks and pins. We have a similar situation with ti_gpio.c.

You could use the DTS to pass the gpio pin (or pins) we need to tweak
at boot to enable the onboard devices.

Luiz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB=2f8yhMGXUmXPGEb4m_ND%2BJLkoi7y4k8KV2OEXw-d7tJkLcw>